package com.jt.base.utils;

/** 常量 */
public class Constant {
  public static final Integer ERROR_CODE_FAILED = -1;
  public static final Integer ERROR_CODE_SUCCESS = 0;
  /** 超级管理员ID */
  public static final int SUPER_ADMIN = 1;
  /** 数据权限过滤 */
  public static final String SQL_FILTER = "sql_filter";
    /** 帐号激活状态 */
    public static final int SYS_USER_STATUS_ACTIVATION = 1;
    /** 帐号冻结状态 */
    public static final int SYS_USER_STATUS_FREEZE = 0;
    /** 用户初始密码 */
    public static final String SYS_USER_INIT_PASSWORD="888888";
  /**
   * 任务调度参数key
   */
  public static final String JOB_PARAM_KEY = "JOB_PARAM_KEY";

  /** 菜单类型 */
  public enum MenuType {
    /** 目录 */
    CATALOG(0),
    /** 菜单 */
    MENU(1),
    /** 按钮 */
    BUTTON(2);

    private int value;

    MenuType(int value) {
      this.value = value;
    }

    public int getValue() {
      return value;
    }
  }

  /** 定时任务状态 */
  public enum ScheduleStatus {
    /** 正常 */
    NORMAL(0),
    /** 暂停 */
    PAUSE(1);

    private int value;

    ScheduleStatus(int value) {
      this.value = value;
    }

    public int getValue() {
      return value;
    }
  }

  public enum ResCode {
    SUCCESS_CODE(0, "成功"),
    ERROR_SERVER(20000, "服务器错误"),
    ERROR_PARAMS_NEED(20001, "缺少必要参数"),
    ERROR_NO_ENCRYPT(20002, "缺少加密参数"),
    ERROR_APPINFO_NOT_EXIST(20003, "APPID不存在"),
    ERROR_APPINFO_INVALID(20004, "APPID无效"),
    ERROR_PAYCONFIGID_NOT_EXIST(20005, "计费点不存在"),
    ERROR_PAYCONFIGID_INVALID(20006, "计费点失效"),
    ERROR_SIGN_WRONG(20007, "签名校验失败"),
    ERROR_TIME_EXPIRE(20008, "时间过期");
    private int value;
    private String desc;
    private ResCode(int value, String desc) {
      this.value = value;
      this.desc = desc;
    }
    public int getValue() {
      return value;
    }
    public String getDesc() {
      return desc;
    }
  }

  public enum StatusCode {
    STATUS_INVALID(0, "无效"),
    STATUS_VALID(1, "有效");
    private int value;
    private String desc;
    private StatusCode(int value, String desc) {
      this.value = value;
      this.desc = desc;
    }
    public int getValue() {
      return value;
    }
    public String getDesc() {
      return desc;
    }

  }
}
